package com.myproject.AnonymousClass;

import com.myproject.thread.Service;


public class Test {


    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void printName(){

        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(getName());
                System.out.println(this.getClass().getName());
            }
        }).start();
    }

    public static void main(String[] args) {

        Test test = new Test();
        //test.setName("dog");
        test.printName();
    }
}
